{% extends "base.html" %}
{% block script %}
	$(".bt_order").attr("id","Ordering_act");
	$("#orderSpend").change(function(){
		window.location.href = $(this).val()
	});
{% endblock %}
{% load pagination_tags %}
{% block left_content %}

         <div class="lc"><img src="{{STATIC_URL}}image/lc.jpg"></div>
         
         <img src="{{STATIC_URL}}image/sx.jpg">
         <span class="word_type1">按照美食圈和餐厅类别对搜索结果进行筛选</span>
          <div class="search_type">
              <table class="landmark"><tbody>
              <tr>
                <td width="20%" class="title1">
                  美食圈                     
              </td>
              <td class="search_content">
                 <ul>
                 {% for ba in bus_area %}
                     <li>
                     	<a href="/order/?busarea={{ba.id}}&cuisine={{selectField.cuisine}}&spend={{selectField.spend}}&orderspend={{orderField.orderspend}}">
                     		{% ifequal selectField.busarea ba.id %}
                     			<font color="red">{{ba.name}}</font>
                     		{% else %}
                     			{{ba.name}}
                     		{% endifequal %}
                     	</a>
                     </li>                    
                 {% endfor %}
                 	<li>
                     	<a href="/order/?busarea=&cuisine={{selectField.cuisine}}&spend={{selectField.spend}}&orderspend={{orderField.orderspend}}">
                     		{% if not selectField.busarea %}
                     			<font color="red">全部</font>
                     		{% else %}
                     			全部
                     		{% endif %}
                     	</a>
                     </li>
                  </ul>         
              </td>
              </tr>
              <tr>             
              <td class="title1">
		 菜系                 
              </td>
              <td class="search_content">
                   <ul>
                  {% for c in hot_cuis %}
	                  <li>
	                  	<a href="/order/?busarea={{selectField.busarea}}&cuisine={{c.id}}&spend={{selectField.spend}}&orderspend={{orderField.orderspend}}">
	                  			
	                  		{% ifequal selectField.cuisine c.id  %}
                     			<font color="red">{{c.name}}</font>
                     		{% else %}
                     			{{c.name}}
                     		{% endifequal %}
	                  	</a>
	                  </li>
                  {% endfor %}
                  	<li>
                     	<a href="/order/?busarea={{selectField.busarea}}&cuisine=&spend={{selectField.spend}}&orderspend={{orderField.orderspend}}">
                     		{% if not selectField.cuisine %}
                     			<font color="red">全部</font>
                     		{% else %}
                     			全部
                     		{% endif %}
                     	</a>
                     </li>
                  </ul>
              </td>
              </tr>
              </tbody></table>              
          </div>
       
       
       <div class="restaurant_list">
       
          <div class="sort">
             排序
             {% if orderField.orderspend == '-spend'%}
             <a href="/order/?busarea={{selectField.busarea}}&cuisine={{selectField.cuisine}}&spend={{selectField.spend}}&orderspend=spend">人均 ↑</a>
             {% else %}
             <a href="/order/?busarea={{selectField.busarea}}&cuisine={{selectField.cuisine}}&spend={{selectField.spend}}&orderspend=-spend">人均 ↓</a>
             {% endif %}
             <!-- <a href="">好评率 ↓</a> -->
             
             人均：
             <select name="spend" id="orderSpend">
                <option value="/order/?busarea={{selectField.busarea}}&cuisine={{selectField.cuisine}}&spend=&orderspend={{orderField.orderspend}}">不限</option>
                {% for s in spend %}
		            <option  
		            	{% if selectField.spend == s.id %}
		            		selected
		            	{% endif %}
		            	value="/order/?busarea={{selectField.busarea}}&cuisine={{selectField.cuisine}}&spend={{s.id}}&orderspend={{orderField.orderspend}}">{{s.value}}</option>
                {% endfor %}
             </select>
             
             <!-- <span class="right_ab">
             每页显示数量
             <a href="">10</a>
             <a href="">20</a>
             <a href="">30</a>
             </span> -->
          </div>
          {% autopaginate rests 10%}
  		  {% for r in rests %}        
          <div class="restaurant_alone">             
             <table class="res_intro"><tbody>
                <tr>
                   <td colspan="3"><span class="res_name"><a href="/rest/{{r.alias}}/" target="_blank">{{r.name}}</a></span>
                     <span class="res_info">
                       <a href="/rest/{{r.alias}}/" target="_blank">详细信息</a>
                       <a href="#">点评</a>
                       6人消费                      
                    </span>
                    </td>                   
                </tr>                
                <tr>
                   <td width="30%" class="left_bg"><a href="/rest/{{r.alias}}/" target="_blank"><img src="/image/{{r.img}}" width="150" height="150"></a></td>
                   <td rowspan="2" width="58%" class="center_bg">
                       
                       <table class="info_form"><tbody>
                          <tr>
                             <td class="right" width="60px">主打菜系：</td>
                             <td>{{r.cuisine.name}}</td>
                          </tr>
                          <tr>
                             <td class="right">招牌菜：</td>
                             <td class="td_content">{%for d in r.rest_dish_set.all %}{%if d.special %}{{d.name}}&nbsp;&nbsp;&nbsp;{%endif%}{%endfor%}</td>
                          </tr>
                          <tr>
                             <td class="right">地址：</td>
                             <td class="td_content">{{r.address}}</td>
                          </tr>
                          <tr>
                            <td class="right">营业时间：</td>
                            <td>{{r.open_time}}-{{r.close_time}}</td>
                          </tr>
                          <tr>
                             <td colspan="2" class="right"><a href="/rest/{{r.alias}}/dish/" title="还等什么，赶紧去体验网上点餐吧！">餐厅点餐</a></td>
                          </tr>                 
                       </tbody></table>
                       
                   </td>
                   
                   <td rowspan="2" class="center_bg">
                     <ul>
                        <li class="orange">人均消费：</li>
                        <li>{{r.spend}}</li>
                        <li></li>
                        <li class="orange3">折扣优惠：</li>
                        <li>8.5折~9.5折</li>
                     </ul>
                   </td>
                </tr>
                
                <tr>
                   <td class="left_bg">五星</td>                              
                </tr>                
             </tbody></table>
          </div>
          {% endfor %}
          
          
          <div class="count">
             {% paginate %}
          </div>          
           
       </div>   
{% endblock %}
  
{% block right_content %}
            {% include "frag/home_right.html" %}
{% endblock %}
 
